<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<?php
    session_start();
    if (array_key_exists("userId", $_SESSION)) {
        header("Location: paginas/principal.php");
    }
    $msg = "";
    if (array_key_exists("invalido", $_GET)) {
        $msg = "Usuario ou Senha Inválidos";
    }else if (array_key_exists("newsucess", $_GET)){
        $msg = "Usuário cadastrado com sucesso";
    }
?>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <link rel="stylesheet" type="text/css" href="css/style.css"/>
        <title>WEBEMAIL</title>
    </head>
    <body>
        <div id="login">
            <div id="logo">
                <img alt="logo" src="css/imagens/logo.png" />
                <h4>Autenticação</h4>
            </div>
            <div id="msg" style="color:red;">
                <?php 
                    if($msg != ""){
                        echo $msg;
                    }  
                ?>
            </div>               
            <form method="post" action="php/Login.php">
                <table>
                    <td>
                    <tr>
                        <td><strong>Email:</strong></td> 
                        <td><input id="email" name="email" type="text" />@webmail.com <br/></td>
                    </tr>
                    </td>
                    <td>
                    <tr>
                        <td><strong>Senha:</strong></td>
                        <td><input id="senha" name="senha" type="password" /> <br/></td>
                    </tr>
                    </td>
                    <td><input id="buttonLogin" value="Login" type="submit" /> <br/></td>

                </table>
            </form>
            <div id="novoUsuario" style="color:red;">
                <a href="novoUsuario.php">Cadastrar-se</a>
            </div> 
        </div>
    </body>
</html>
